<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Favorite fruit length constraint</title>
    <style>
      input:invalid {
        border: 2px dashed red;
      }

      input:valid {
        border: 2px solid black;
      }

      div {
        margin-bottom: 1rem;
      }
      form {
        margin: 2rem 0 2rem 0;
      }
    </style>
  </head>

  <body>
    <form>
      <div>
        <label for="choose">Would you prefer a banana or a cherry?</label>
        <input id="choose" name="i_like" required minlength="6" maxlength="6" />
      </div>
      <div>
        <label for="number">How many would you like?</label>
        <input
          type="number"
          id="number"
          name="amount"
          value="1"
          min="1"
          max="10"
        />
      </div>
      <div>
        <button>Submit</button>
      </div>
    </form>
  </body>
</html>
